﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Engine.Rule
{
    public class AbilityType : AttributeType
    {
        public AbilityType(string name, string description)
            : base(name, description)
        {

        }

        public AbilityType()
            : this("", "")
        {
        }
    }

    public class Ability : Attribute<AbilityType>
    {
        public Ability(AbilityType abilityType, int value)
            : base(abilityType, value)
        {
        }

        public Ability()
            : this(null, 0)
        {
        }
    }

    public class AbilityTypeGroup : AttributeTypeGroup<AbilityType>
    {
        private const int ABILITY_COUNT = 5;
        public AbilityTypeGroup()
            : base(new AbilityType[ABILITY_COUNT])
        {
        }
    }

    public class AbilityGroup : AttributeGroup<AbilityType, Ability, AbilityTypeGroup>
    {
        private const int ABILITY_LIMIT_MIN = 0;
        private const int ABILITY_LIMIT_MAX = 10;
        public AbilityGroup(AbilityTypeGroup array)
            : base(array)
        {
        }

        public override int LimitMin
        {
            get { return ABILITY_LIMIT_MIN; }
        }

        public override int LimitMax
        {
            get { return ABILITY_LIMIT_MAX; }
        }

        protected override Ability createAttribute(AbilityType attributeType, int value)
        {
            return new Ability(attributeType, value);
        }
    }
}
